\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthemeSampa}[2016/11/19 Sampa outer theme]
\RequirePackage{etoolbox}
\RequirePackage{calc}
\RequirePackage{pgfopts}
\RequirePackage{tikz}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]


\newlength{\marginedPaperWidth}{\paperwidth - 0.2cm}

% Frame title
\defbeamertemplate*{frametitle}{lucid}[1][]{
  \vskip0.2cm%
  \begin{beamercolorbox}[wd=\paperwidth,ht=1.1cm]{frametitle} 
    \begin{tikzpicture}
      \useasboundingbox(0,0) rectangle(\the\paperwidth,1.1);
      \fill[color = title] (0.14,0) rectangle(\the\marginedPaperWidth,1);
      \ifx\insertframesubtitle\@empty%
      {\node[anchor=west] at (0.3,0.5){\usebeamerfont{frametitle}\insertframetitle};}
      \else%
      {\node[anchor= west] (ttl) at (0.3,0.73){\usebeamerfont{frametitle}\insertframetitle};%
        \node[anchor = west] at (0.5,0.22){\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle};
      }%
      \fi
    \end{tikzpicture}
  \end{beamercolorbox}
}

\endinput
